package com.etc.systax;

//: BooleanTest.java
//Relational and logical operators
import java.util.*;

public class BooleanTest {
	public static void main(String[] args) {
		Random rand = new Random();
		int i = rand.nextInt() % 100;
		int j = rand.nextInt() % 100;
		prt("i = " + i);
		prt("j = " + j);
		prt("i > j is " + (i > j));
		prt("i < j is " + (i < j));
		prt("i >= j is " + (i >= j));
		prt("i <= j is " + (i <= j));
		prt("i == j is " + (i == j));
		prt("i != j is " + (i != j));

		// Treating an int as a boolean is
		// not legal Java
		// ! prt("i && j is " + (i && j));
		// ! prt("i || j is " + (i || j));
		// ! prt("!i is " + !i);

		prt("(i < 10) && (j < 10) is " + ((i < 10) && (j < 10)));
		prt("(i < 10) || (j < 10) is " + ((i < 10) || (j < 10)));
	}

	static void prt(String s) {
		System.out.println(s);
	}
}
